jquery slidetoggle expands and collapses straight away [migrated]
Posted
by
Floran
on Pro Webmasters
See other posts from Pro Webmasters
or by Floran
Published on 2012-06-24T18:35:27Z
Indexed on
2012/06/24
21:23 UTC
Read the original article
Hit count: 250
jQuery
Please see here: http://www.wunderwedding.com/weddingvenues/search
On the left side there's a filter 'show more cities...'
When it's clicked I want to show more cities. But right now when it's clicked the box expands and IMMEDIATELY collapses again. I dont know what Im doing wrong. This is the code for show/hide:
$("#toggle_cities").click(function () {
if ($("#facets_city").is(":visible")) {
$("#toggle_cities").text('toon meer steden...');
}
else {
$("#toggle_cities").text('toon minder steden...');
}
$("#facets_city").slideToggle("slow");
});
© Pro Webmasters or respective owner